import os
import sys
import unittest

"""
PYUNIT

http://pyunit.sourceforge.net/pyunit.html#SIMPLECASE

"""


#ugly hack but quick and efficient !
#adapt to your src location
sources='/home/tifauve/Documents/Code/Python/catanyste'
sys.path.append(sources + '/src')
from gamecomponents import GameComponents

class DefaultGameComponentTestCase(unittest.TestCase):
    def runTest(self):
        #testing resource_fields with player = 4
        compo = GameComponents()
        assert compo.resource_fields ==  {GameComponents.EARTH_FIELDS:{
                                     GameComponents.LUMBER:4,
                                     GameComponents.BRICK:3,
                                     GameComponents.WOOL:4,
                                     GameComponents.GRAIN:4,
                                     GameComponents.ORE:3,
                                     GameComponents.DESERT:1},
                                     GameComponents.SEA_FIELDS:{
                                     GameComponents.WATER:9,
                                     GameComponents.PORT3:4,
                                     GameComponents.PORT2:{
                                         GameComponents.PORT2LUMBER:1,
                                         GameComponents.PORT2BRICK:1,
                                         GameComponents.PORT2WOOL:1,
                                         GameComponents.PORT2GRAIN:1,
                                         GameComponents.PORT2ORE:1}}}


if __name__ == "__main__":
    unittest.main()
